package com.jwater.core.manager.master.event;

import com.jwater.core.serialize.ProtoStuffSerialize;

/**
 * @description:
 * @author: jnner
 * @createDate: 2021/2/5
 * @version: 1.0
 */
public abstract class GroupEvent {
    public static final ProtoStuffSerialize SERIALIZE = new ProtoStuffSerialize();

    public static final String TYPE_LOGIN = "login";
    public static final String TYPE_OFFLINE = "offline";
    public static final String TYPE_ADD_WORKER = "addWorker";
    public static final String TYPE_REMOVE_WORKER = "removeWorker";
    public static final String TYPE_REMOVE_GROUP_WORKER = "removeGroupWorker";
    public static final String TYPE_START_JOB = "startJob";
    public static final String TYPE_STOP_JOB = "stopJob";
    public static final String TYPE_COMPLETE_JOB = "completeJob";
    public static final String TYPE_REPORT = "report";
    public static final String TYPE_PROXY_REPORT = "proxyReport";
    public static final String TYPE_ALARM_REPORT = "alarmReport";
    public static final String TYPE_REPEAT_WORKER = "repeatWorker";

    public abstract String getType();

    public abstract byte[] serialize();

    public abstract GroupEvent deserialize(byte[] data);
}
